package architect.design.patterns.structural.adapter;

/**
 * VGA2HDMI适配器
 *
 * @author guanxin
 * @date 2018/5/5 14:21
 */

public class VgaToHdmiAdapter implements IHdmi {
    private IVga vgaDisplay;

    public VgaToHdmiAdapter(IVga vgaDisplay) {
        this.vgaDisplay = vgaDisplay;
    }

    public void openHdmi() {
        // 适配逻辑
        this.vgaDisplay.openVga();
        System.out.println("Opening HDMI device");
    }
}
